Skip to content

Conversation

@andrewwhitehead
Copy link
Contributor

@andrewwhitehead andrewwhitehead commented Oct 29, 2025

This optimizes Int::wrapping_mul and Uint::checked_mul_int to make use of Uint::wrapping_mul, and adds Int::saturating_mul.

Signed-off-by: Andrew Whitehead <[email protected]>
Signed-off-by: Andrew Whitehead <[email protected]>
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 98.41270% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.84%. Comparing base (56e6c4a) to head (8b7d103).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/int/mul.rs 98.93% 1 Missing ⚠️
src/int/mul_uint.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #998      +/-   ##
==========================================
- Coverage   79.87%   79.84%   -0.03%     
==========================================
  Files         163      163              
  Lines       17593    17696     +103     
==========================================
+ Hits        14052    14129      +77     
- Misses       3541     3567      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

simplify Int::wrapping_mul and add test

Signed-off-by: Andrew Whitehead <[email protected]>
pub const SIGN_MASK: Self = Self::MIN; // Bit sequence (be): 1000....0000

/// All-one bit mask.
pub const FULL_MASK: Self = Self(Uint::MAX); // Bit sequence (be): 1111...1111
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constant was public, but I can't imagine what it would be needed for, besides the internal usage in calculating MINUS_ONE which has been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant